package demo.database;

import java.sql.Connection;

import com.titan.core.utils.db.DBUtils;

/**
 * 
 * 
 * @author 周成功
 * 
 */
public class TestConnection {

    public static void main(String[] args) {
        Connection conn = null;
        try {
            //conn = DBUtils.getOracleConnection("192.168.128.212", "1521", "ORCL", "system", "12345678", true);
            conn = DBUtils.getMSSQLConnection("192.168.128.213", "1433", "H20170913", "sa", "123456", true);
            
            long time = System.currentTimeMillis();
            System.out.println(DBUtils.getValue(conn, "SELECT GETDATE() AS CurrentDateTime"));
            time = System.currentTimeMillis() - time;
            System.out.println("user time : " + time + "ms");
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            DBUtils.close(conn);
        }
    }
}
